<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      >
<head th:replace="fragments/tabhead::headc"></head>

<body>

<th:block layout:fragment="content">
<!-- 销售订单 -->
<div style="margin-top:15px">
  <form class="layui-form search" id="searchForm">
  <div class="layui-form-item layui-elem-quote">
    <div class="layui-inline">
      <label class="layui-form-label" style="width:80px;margin-left:-20px">描述</label>
      <div class="layui-input-inline" style="width:200px">
        <input type="text" name="description" class="layui-input" placeholder="请输入描述"/>
      </div>
    </div>
    <div class="layui-inline">
      <label class="layui-form-label" style="width:60px;margin-left:-20px">时间</label>
      <div class="layui-input-inline" style="width:200px">
        <input type="text" id="startDate" class="layui-input" name='startDate'/>
      </div>
       <div class="layui-form-mid">-</div>
      <div class="layui-input-inline" style="width:200px">
        <input type="text" id="endDate" class="layui-input" name="endDate"/>
      </div>
    </div>
	
    <div class="layui-inline">
      <div class="layui-input-inline" style="width:150px;">
        <button class="layui-btn" id="searchBtn" type="button" authcode="900257">查询</button>
      </div>
    </div>
    
  </div>
 </form>
</div>

<table class="layui-table"  id="tab" lay-filter="tab"></table>
<script>
var ins,page,trobj,editdialogindex,table;
$(function(){ 
	
	layui.use(['table','layer'], function(){
		table = layui.table;
		ins =table.render({ //其它参数在此省略
		 elem:"#tab",
		 url: '/sys/log/data?first=true',
		 cols:[[
			  {field:'id',width:80, sort: true,title:'ID',fixed:'true'},
		      {field:'name', width:120,title:'操作人'},
		      {field:'executeTime', width:120, sort: true,title:'执行时间(ms)'},
		      {field:'ip', width:130,title:'客户端ip'},
		      {field:'method',width:190,title:'方法'},
		      {field:'args', width:180, sort: true,title:'args'},
		      {field:'description', width:180,title:'描述'},
		      {field:'ctime', width:200,title:'日志记录时间'},
		 ]]
	    ,page: true //是否显示分页
	    ,limits: [10,20,50]
	    ,limit:10 //每页默认显示的数量
		  //where:{phone:phone}
		  //method: 'post'
		 ,done:function(res,curr,count){
			 console.log(res);
			 page = curr;
			    //得到当前页码
			    console.log(curr); 
			    
			    //得到数据总量
			    console.log(count);
		 }
		});
		
		//表格重载，确定当前的页按钮
		function reloadData(){
			$(".layui-laypage-btn")[0].click();//页面的确定按钮
			
		}
		
		$("#searchBtn").click(function(){
			var table = layui.table;
		    ins.reload({url: '/sys/log/data',where:$("#searchForm").serializeJson()})
		    return false;
		});
	});
		
	layui.use("laydate",function(){
		var laydate = layui.laydate;
		laydate.render({
			  elem: '#startDate'//指定元素
			  ,type: 'datetime'
			  
			  ,done: function (value,date,enddate){
				  console.log(value);
				  console.log(date);
				  console.log(enddate);
			  }
			});
		laydate.render({
			  elem: '#endDate' //指定元素
			  ,type: 'datetime'
			  ,done: function(value,date,enddate){
				console.log(value);				 
			  }
			});
	});
}); 

</script>
<!--<div th:replace="/department/model::modelDiv"></div>-->
</th:block>
</body>
</html>